home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7475 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 6e | 74 70 64 32 2e 63 78 6f |Path: nn|tpd2.cxo|
|00000010| 2e 64 65 63 2e 63 6f 6d | 21 75 73 65 6e 65 74 0a |.dec.com|!usenet.|
|00000020| 46 72 6f 6d 3a 20 42 72 | 69 61 6e 20 48 69 62 62 |From: Br|ian Hibb|
|00000030| 65 72 74 20 3c 62 5f 68 | 69 62 62 65 72 74 40 63 |ert <b_h|ibbert@c|
|00000040| 73 63 33 32 2e 65 6e 65 | 74 2e 64 65 63 2e 63 6f |sc32.ene|t.dec.co|
|00000050| 6d 3e 0a 4e 65 77 73 67 | 72 6f 75 70 73 3a 20 63 |m>.Newsg|roups: c|
|00000060| 6f 6d 70 2e 6c 61 6e 67 | 2e 63 2b 2b 0a 53 75 62 |omp.lang|.c++.Sub|
|00000070| 6a 65 63 74 3a 20 52 65 | 3a 20 4e 65 65 64 20 73 |ject: Re|: Need s|
|00000080| 6f 6d 65 20 73 69 6d 70 | 6c 65 20 68 65 6c 70 20 |ome simp|le help |
|00000090| 77 69 74 68 20 43 2b 2b | 0a 44 61 74 65 3a 20 32 |with C++|.Date: 2|
|000000a0| 33 20 46 65 62 20 31 39 | 39 36 20 31 34 3a 34 34 |3 Feb 19|96 14:44|
|000000b0| 3a 31 36 20 47 4d 54 0a | 4f 72 67 61 6e 69 7a 61 |:16 GMT.|Organiza|
|000000c0| 74 69 6f 6e 3a 20 44 69 | 67 69 74 61 6c 20 45 71 |tion: Di|gital Eq|
|000000d0| 75 69 70 6d 65 6e 74 20 | 43 6f 72 70 6f 72 61 74 |uipment |Corporat|
|000000e0| 69 6f 6e 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |ion.Mess|age-ID: |
|000000f0| 3c 34 67 6b 6a 73 30 24 | 38 32 64 40 6e 6e 74 70 |<4gkjs0$|82d@nntp|
|00000100| 64 32 2e 63 78 6f 2e 64 | 65 63 2e 63 6f 6d 3e 0a |d2.cxo.d|ec.com>.|
|00000110| 52 65 66 65 72 65 6e 63 | 65 73 3a 20 3c 34 67 69 |Referenc|es: <4gi|
|00000120| 38 31 6b 24 65 62 62 40 | 73 70 68 69 6e 78 2e 47 |81k$ebb@|sphinx.G|
|00000130| 73 75 2e 45 44 55 3e 0a | 4e 4e 54 50 2d 50 6f 73 |su.EDU>.|NNTP-Pos|
|00000140| 74 69 6e 67 2d 48 6f 73 | 74 3a 20 70 65 6f 31 30 |ting-Hos|t: peo10|
|00000150| 31 32 5f 70 6f 72 74 32 | 2e 70 65 6f 2e 64 65 63 |12_port2|.peo.dec|
|00000160| 2e 63 6f 6d 0a 4d 69 6d | 65 2d 56 65 72 73 69 6f |.com.Mim|e-Versio|
|00000170| 6e 3a 20 31 2e 30 0a 43 | 6f 6e 74 65 6e 74 2d 54 |n: 1.0.C|ontent-T|
|00000180| 79 70 65 3a 20 74 65 78 | 74 2f 70 6c 61 69 6e 3b |ype: tex|t/plain;|
|00000190| 20 63 68 61 72 73 65 74 | 3d 75 73 2d 61 73 63 69 | charset|=us-asci|
|000001a0| 69 0a 43 6f 6e 74 65 6e | 74 2d 54 72 61 6e 73 66 |i.Conten|t-Transf|
|000001b0| 65 72 2d 45 6e 63 6f 64 | 69 6e 67 3a 20 37 62 69 |er-Encod|ing: 7bi|
|000001c0| 74 0a 58 2d 4d 61 69 6c | 65 72 3a 20 4d 6f 7a 69 |t.X-Mail|er: Mozi|
|000001d0| 6c 6c 61 20 31 2e 32 4e | 20 28 57 69 6e 64 6f 77 |lla 1.2N| (Window|
|000001e0| 73 3b 20 49 3b 20 31 36 | 62 69 74 29 0a 54 6f 3a |s; I; 16|bit).To:|
|000001f0| 20 67 73 30 31 6c 6d 68 | 40 70 61 6e 74 68 65 72 | gs01lmh|@panther|
|00000200| 2e 47 73 75 2e 45 44 55 | 0a 0a 67 73 30 31 6c 6d |.Gsu.EDU|..gs01lm|
|00000210| 68 40 70 61 6e 74 68 65 | 72 2e 47 73 75 2e 45 44 |h@panthe|r.Gsu.ED|
|00000220| 55 20 28 4c 6f 75 69 73 | 20 4d 69 6c 6c 65 72 20 |U (Louis| Miller |
|00000230| 48 61 6c 6c 29 20 77 72 | 6f 74 65 3a 0a 3e 49 20 |Hall) wr|ote:.>I |
|00000240| 61 6d 20 68 61 76 69 6e | 67 20 61 20 70 72 6f 62 |am havin|g a prob|
|00000250| 6c 65 6d 20 67 65 74 74 | 69 6e 67 20 74 68 65 20 |lem gett|ing the |
|00000260| 66 6f 6c 6c 6f 77 69 6e | 67 20 63 6f 64 65 20 74 |followin|g code t|
|00000270| 6f 20 72 65 75 73 65 20 | 61 20 73 74 72 69 6e 67 |o reuse |a string|
|00000280| 20 73 6f 20 0a 3e 74 68 | 61 74 20 49 20 63 61 6e | so .>th|at I can|
|00000290| 20 70 75 74 20 61 6e 64 | 20 70 72 69 6e 74 20 76 | put and| print v|
|000002a0| 61 72 69 6f 75 73 20 69 | 6e 66 6f 20 69 6e 74 6f |arious i|nfo into|
|000002b0| 20 69 74 2c 20 77 68 65 | 6e 20 74 68 65 20 70 72 | it, whe|n the pr|
|000002c0| 6f 67 72 61 6d 20 72 75 | 6e 73 2c 20 69 74 20 0a |ogram ru|ns, it .|
|000002d0| 3e 77 69 6c 6c 20 73 75 | 63 63 65 73 73 66 75 6c |>will su|ccessful|
|000002e0| 6c 79 20 6f 75 74 70 75 | 74 20 74 68 65 20 64 61 |ly outpu|t the da|
|000002f0| 74 61 20 74 68 65 20 66 | 69 72 73 74 20 74 69 6d |ta the f|irst tim|
|00000300| 65 20 74 68 72 6f 75 67 | 68 20 74 68 65 20 6c 6f |e throug|h the lo|
|00000310| 6f 70 2c 20 62 75 74 20 | 0a 3e 61 66 74 65 72 20 |op, but |.>after |
|00000320| 74 68 61 74 2c 20 69 74 | 20 77 69 6c 6c 20 63 6f |that, it| will co|
|00000330| 6e 74 69 6e 75 65 20 74 | 6f 20 72 75 6e 2c 20 62 |ntinue t|o run, b|
|00000340| 75 74 20 6e 6f 74 20 61 | 6c 6c 6f 77 20 79 6f 75 |ut not a|llow you|
|00000350| 20 74 6f 20 65 6e 74 65 | 72 20 61 6e 6f 74 68 65 | to ente|r anothe|
|00000360| 72 20 0a 3e 73 74 72 69 | 6e 67 2c 20 61 6e 64 20 |r .>stri|ng, and |
|00000370| 6d 6f 72 65 6f 76 65 72 | 20 6f 75 74 70 75 74 73 |moreover| outputs|
|00000380| 20 61 6e 20 65 6d 70 74 | 79 20 73 74 72 69 6e 67 | an empt|y string|
|00000390| 3f 3f 21 21 21 3f 20 43 | 61 6e 20 61 6e 79 62 6f |??!!!? C|an anybo|
|000003a0| 64 79 20 74 65 6c 6c 20 | 6d 65 20 0a 3e 77 68 61 |dy tell |me .>wha|
|000003b0| 74 20 49 20 61 6d 20 64 | 6f 69 6e 67 20 77 72 6f |t I am d|oing wro|
|000003c0| 6e 67 3a 0a 3e 0a 3e 23 | 69 6e 63 6c 75 64 65 20 |ng:.>.>#|include |
|000003d0| 3c 66 73 74 72 65 61 6d | 2e 68 3e 0a 3e 0a 3e 63 |<fstream|.h>.>.>c|
|000003e0| 68 61 72 20 2a 6e 61 6d | 65 3b 0a 3e 69 6e 74 20 |har *nam|e;.>int |
|000003f0| 20 61 20 3d 20 31 3b 0a | 3e 0a 3e 76 6f 69 64 20 | a = 1;.|>.>void |
|00000400| 6d 61 69 6e 20 28 29 0a | 3e 20 20 7b 0a 3e 20 20 |main ().|> {.> |
|00000410| 77 68 69 6c 65 20 28 61 | 29 0a 3e 20 20 20 20 7b |while (a|).> {|
|00000420| 0a 3e 20 20 20 20 6e 61 | 6d 65 20 3d 20 6e 65 77 |.> na|me = new|
|00000430| 20 63 68 61 72 5b 38 30 | 5d 3b 0a 54 68 69 73 20 | char[80|];.This |
|00000440| 73 68 6f 75 6c 64 20 62 | 65 20 6d 6f 76 65 64 20 |should b|e moved |
|00000450| 6f 75 74 73 69 64 65 20 | 74 68 65 20 6c 6f 6f 70 |outside |the loop|
|00000460| 2e 20 20 49 20 77 6f 75 | 6c 64 20 61 6c 73 6f 20 |. I wou|ld also |
|00000470| 6d 61 6b 65 20 74 68 65 | 20 63 68 61 72 61 63 74 |make the| charact|
|00000480| 65 72 0a 61 72 72 61 79 | 20 6c 61 72 67 65 72 20 |er.array| larger |
|00000490| 74 6f 20 61 6c 6c 6f 77 | 20 66 6f 72 20 61 20 74 |to allow| for a t|
|000004a0| 65 72 6d 69 6e 61 74 69 | 6e 67 20 4e 55 4c 4c 2e |erminati|ng NULL.|
|000004b0| 20 20 54 68 69 73 20 77 | 69 6c 6c 20 6e 6f 74 20 | This w|ill not |
|000004c0| 63 68 61 6e 67 65 20 74 | 68 65 20 0a 66 75 6e 63 |change t|he .func|
|000004d0| 74 69 6f 6e 20 6f 66 20 | 79 6f 75 72 20 70 72 6f |tion of |your pro|
|000004e0| 67 72 61 6d 2c 20 62 75 | 74 20 64 6f 65 73 20 61 |gram, bu|t does a|
|000004f0| 66 66 65 63 74 20 70 65 | 72 66 6f 72 6d 61 6e 63 |ffect pe|rformanc|
|00000500| 65 20 28 6e 6f 74 20 74 | 68 61 74 20 0a 70 65 72 |e (not t|hat .per|
|00000510| 66 6f 72 6d 61 6e 63 65 | 20 6d 61 74 74 65 72 73 |formance| matters|
|00000520| 20 66 6f 72 20 74 68 69 | 73 20 70 72 6f 67 72 61 | for thi|s progra|
|00000530| 6d 29 2e 0a 20 0a 3e 20 | 20 20 20 63 6f 75 74 20 |m).. .> | cout |
|00000540| 3c 3c 20 22 57 68 61 74 | 20 69 73 20 74 68 65 20 |<< "What| is the |
|00000550| 73 74 72 69 6e 67 20 3e | 22 20 3c 3c 20 65 6e 64 |string >|" << end|
|00000560| 6c 3b 0a 3e 20 20 20 20 | 63 69 6e 2e 67 65 74 6c |l;.> |cin.getl|
|00000570| 69 6e 65 28 6e 61 6d 65 | 2c 20 38 30 29 3b 0a 54 |ine(name|, 80);.T|
|00000580| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 77 69 6c |his func|tion wil|
|00000590| 6c 20 72 65 61 64 20 75 | 70 20 74 6f 20 38 30 20 |l read u|p to 80 |
|000005a0| 63 68 61 72 61 63 74 65 | 72 73 20 66 72 6f 6d 20 |characte|rs from |
|000005b0| 63 69 6e 20 6f 72 20 75 | 6e 74 69 6c 20 69 74 20 |cin or u|ntil it |
|000005c0| 0a 65 6e 63 6f 75 6e 74 | 65 72 73 20 61 20 6e 65 |.encount|ers a ne|
|000005d0| 77 6c 69 6e 65 20 63 68 | 61 72 61 63 74 65 72 2e |wline ch|aracter.|
|000005e0| 0a 3e 20 20 20 20 63 6f | 75 74 20 3c 3c 20 22 54 |.> co|ut << "T|
|000005f0| 68 65 20 73 74 72 69 6e | 67 20 65 6e 74 65 72 65 |he strin|g entere|
|00000600| 64 20 69 73 20 3e 22 20 | 3c 3c 20 6e 61 6d 65 20 |d is >" |<< name |
|00000610| 3c 3c 20 65 6e 64 6c 3b | 0a 3e 20 20 20 20 63 6f |<< endl;|.> co|
|00000620| 75 74 20 3c 3c 20 22 45 | 6e 74 65 72 20 30 20 74 |ut << "E|nter 0 t|
|00000630| 6f 20 71 75 69 74 2c 20 | 61 6e 79 20 6f 74 68 65 |o quit, |any othe|
|00000640| 72 20 74 6f 20 63 6f 6e | 74 69 6e 75 65 3e 22 3b |r to con|tinue>";|
|00000650| 0a 3e 20 20 20 20 63 69 | 6e 20 3e 3e 20 61 3b 0a |.> ci|n >> a;.|
|00000660| 41 66 74 65 72 20 74 68 | 65 20 65 6e 74 65 72 20 |After th|e enter |
|00000670| 6b 65 79 20 69 73 20 70 | 72 65 73 73 65 64 20 74 |key is p|ressed t|
|00000680| 68 65 20 69 6e 74 20 69 | 73 20 65 78 74 72 61 63 |he int i|s extrac|
|00000690| 74 65 64 20 66 72 6f 6d | 20 74 68 65 20 69 6e 70 |ted from| the inp|
|000006a0| 75 74 20 73 74 72 65 61 | 6d 0a 62 75 74 20 74 68 |ut strea|m.but th|
|000006b0| 65 20 6e 65 77 6c 69 6e | 65 20 69 73 20 73 74 69 |e newlin|e is sti|
|000006c0| 6c 6c 20 69 6e 20 74 68 | 65 20 62 75 66 66 65 72 |ll in th|e buffer|
|000006d0| 2e 20 20 54 68 69 73 20 | 6d 65 61 6e 73 20 74 68 |. This |means th|
|000006e0| 61 74 20 74 68 65 20 67 | 65 74 6c 69 6e 65 28 29 |at the g|etline()|
|000006f0| 0a 61 62 6f 76 65 20 77 | 69 6c 6c 20 73 65 65 20 |.above w|ill see |
|00000700| 74 68 65 20 6e 65 77 6c | 69 6e 65 20 63 68 61 72 |the newl|ine char|
|00000710| 61 63 74 65 72 20 77 68 | 69 63 68 20 74 65 72 6d |acter wh|ich term|
|00000720| 69 6e 61 74 65 73 20 69 | 74 73 20 69 6e 70 75 74 |inates i|ts input|
|00000730| 20 61 6e 64 20 0a 72 65 | 74 75 72 6e 73 20 61 6e | and .re|turns an|
|00000740| 20 65 6d 70 74 79 20 73 | 74 72 69 6e 67 2e 0a 20 | empty s|tring.. |
|00000750| 20 20 41 64 64 20 61 3a | 0a 20 20 20 20 20 63 69 | Add a:|. ci|
|00000760| 6e 2e 69 67 6e 6f 72 65 | 28 38 30 29 3b 20 2f 2f |n.ignore|(80); //|
|00000770| 20 77 69 6c 6c 20 69 67 | 6e 6f 72 65 20 61 6e 79 | will ig|nore any|
|00000780| 74 68 69 6e 67 20 61 66 | 74 65 72 20 74 68 65 20 |thing af|ter the |
|00000790| 69 6e 74 0a 0a 3e 20 20 | 20 20 64 65 6c 65 74 65 |int..> | delete|
|000007a0| 20 6e 61 6d 65 3b 20 20 | 2f 2f 20 77 69 6c 6c 20 | name; |// will |
|000007b0| 77 6f 72 6b 20 74 68 65 | 20 73 61 6d 65 20 77 69 |work the| same wi|
|000007c0| 74 68 20 6f 72 20 77 69 | 74 68 6f 75 74 20 74 68 |th or wi|thout th|
|000007d0| 69 73 0a 54 68 69 73 20 | 73 68 6f 75 6c 64 20 61 |is.This |should a|
|000007e0| 6c 73 6f 20 62 65 20 6d | 6f 76 65 64 20 6f 75 74 |lso be m|oved out|
|000007f0| 73 69 64 65 20 74 68 65 | 20 6c 6f 6f 70 2e 0a 0a |side the| loop...|
|00000800| 3e 20 20 20 20 7d 20 20 | 2f 2f 20 77 68 69 6c 65 |> } |// while|
|00000810| 0a 3e 20 20 7d 20 20 2f | 2f 20 6d 61 69 6e 0a 3e |.> } /|/ main.>|
|00000820| 0a 3e 49 20 68 61 76 65 | 20 61 6c 73 6f 20 74 72 |.>I have| also tr|
|00000830| 69 65 64 20 75 73 69 6e | 67 20 63 68 61 72 20 6e |ied usin|g char n|
|00000840| 61 6d 65 5b 38 30 5d 3b | 20 62 75 74 20 74 68 69 |ame[80];| but thi|
|00000850| 73 20 74 6f 6f 20 66 61 | 69 6c 73 2c 20 49 20 61 |s too fa|ils, I a|
|00000860| 6d 20 74 72 79 69 6e 67 | 20 74 6f 20 0a 3e 74 65 |m trying| to .>te|
|00000870| 61 63 68 20 6d 79 73 65 | 6c 66 20 43 2b 2b 2c 20 |ach myse|lf C++, |
|00000880| 61 6e 64 20 61 6e 79 20 | 61 64 64 74 69 6f 6e 61 |and any |addtiona|
|00000890| 6c 20 68 65 6c 70 20 49 | 20 63 6f 75 6c 64 20 67 |l help I| could g|
|000008a0| 65 74 20 77 6f 75 6c 64 | 20 62 65 20 0a 3e 61 70 |et would| be .>ap|
|000008b0| 70 72 65 63 69 61 74 65 | 64 2e 20 20 0a 3e 0a 3e |preciate|d. .>.>|
|000008c0| 54 68 61 6e 6b 73 0a 3e | 0a 0a 0a 2d 2d 20 0a 2a |Thanks.>|...-- .*|
|000008d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000008e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000008f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0a 42 |********|******.B|
|00000900| 72 69 61 6e 20 48 69 62 | 62 65 72 74 20 20 62 5f |rian Hib|bert b_|
|00000910| 68 69 62 62 65 72 74 40 | 63 73 63 33 32 2e 65 6e |hibbert@|csc32.en|
|00000920| 65 74 2e 64 65 63 2e 63 | 6f 6d 0a 44 69 67 69 74 |et.dec.c|om.Digit|
|00000930| 61 6c 20 45 71 75 69 70 | 6d 65 6e 74 20 43 6f 72 |al Equip|ment Cor|
|00000940| 70 6f 72 61 74 69 6f 6e | 0a 41 6c 6c 20 6f 70 69 |poration|.All opi|
|00000950| 6e 69 6f 6e 73 20 65 78 | 70 72 65 73 73 65 64 20 |nions ex|pressed |
|00000960| 61 72 65 20 6d 79 20 6f | 77 6e 20 61 6e 64 20 73 |are my o|wn and s|
|00000970| 68 6f 75 6c 64 0a 6e 6f | 74 20 62 65 20 61 73 73 |hould.no|t be ass|
|00000980| 75 6d 65 64 20 74 6f 20 | 62 65 20 74 68 65 20 6f |umed to |be the o|
|00000990| 70 69 6e 69 6f 6e 20 6f | 66 20 6d 79 20 65 6d 70 |pinion o|f my emp|
|000009a0| 6c 6f 79 65 72 0a 0a 0a | 0a 0a 0a 0a 0a 0a 0a 0a |loyer...|........|
|000009b0| 0a 0a 0a 0a 0a 0a 0a 0a | 0a 0a |........|.. |
+--------+-------------------------+-------------------------+--------+--------+